#include <algorithm>

#include "tree.h"

int getTreeHeight(TreeNode *root) {
  if (root == nullptr) {
    return 0;
  }

  int leftHeight = getTreeHeight(root->left);
  int rightHeight = getTreeHeight(root->right);

  return std::max(leftHeight, rightHeight) + 1;
}